<!DOCTYPE html>
<html>
<head>
    <title>快印材料</title>
		<#include "/header.html">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/ziyun-erp.css">
    <style>
        html {
            overflow-y: scroll;
        }
        :root {
            overflow-y: auto;
            overflow-x: hidden;
        }
        :root body {
            position: absolute;
        }
        body {
            width: 100vw;
            overflow: hidden;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <!--左侧table-->
            <div v-show="showList">
                <div class="form-group"  >
                <div class="row">
                    <div class="col-md-5">
                    <div class="grid-btn">
                    <div style="padding-bottom: 15px">
                    <#if shiro.hasPermission("quoteFastPrintMaterial:quotefastprintmaterial:save")>
                    <a class="btn btn-primary btn-sm" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
                    </#if>
                    <#if shiro.hasPermission("quoteFastPrintMaterial:quotefastprintmaterial:update")>
                    <a class="btn btn-primary btn-sm" @click="getInfo"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
                    </#if>
                    <#if shiro.hasPermission("quoteFastPrintMaterial:quotefastprintmaterial:delete")>
                    <a class="btn btn-primary btn-sm" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
                    </#if>
                    </div>
                <table id="jqGrid"></table>
                   </div>
                </div>
                <div  class="col-md-6" width="100%">
                    <div style="padding-bottom: 15px">
                    <el-button type="primary" size="small" @click="generateDialog">生成组合</el-button>
                    </div>
                    <!--选项详情table-->
                    <div >
                        <el-table
                                ref="detailTable"
                                :data="detailOptionName2List"
                                border
                                tooltip-effect="dark"
                                @selection-change="handleOptionSelection">
                            >
                            <el-table-column
                                    type="selection"
                                    width="70">
                            </el-table-column>

                            <el-table-column
                                    prop="option_name"
                                    label="材料"
                                    header-align="center"  width="250">
                                <template slot-scope="scope">
                                    <span>{{ scope.row.option_name}}</span>
                                </template>
                            </el-table-column>
                             <el-table-column
                                     prop="option_name2"
                                     label="克重"
                                     width="250">
                                 <template slot-scope="scope">
                                     <span>{{ scope.row.option_name2}}</span>
                                 </template>
                             </el-table-column>
                             <el-table-column
                                     label="是否运用"
                                     width="250">
                                 <template slot-scope="scope">
                                     <el-switch
                                             v-model="scope.row.display"
                                             active-color="#13ce66"
                                             inactive-color="#ff4949"
                                             @change="updateDisplay(scope.row.id)">
                                     </el-switch>
                                 </template>
                             </el-table-column>
                             <el-table-column
                                     label="单位"
                                     >
                             </el-table-column>
                        </el-table>
                    </div>
                </div>
                </div>
     </div>
    </div>
    <div v-show="!showList" class="panel panel-default" style="height: 1400px">
        <div class="panel-heading" >{{title}}</div>
        <form class="form-horizontal"  style="height:auto">
            <div class="form-group">
                <div class="col-sm-2 control-label">材料</div>
                <div class="col-sm-10">
                    <template>
                        <el-select size="small"  @change="findAllOptionName2(quoteFastPrintMaterial.optionName)" v-model="quoteFastPrintMaterial.optionName" placeholder="请选择">
                            <el-option
                                    v-for="item in quoteOptionNameList"
                                    :key="item"
                                    :value="item">
                            </el-option>
                        </el-select>
                    </template>
                </div>
            </div>
            <!--optionName2列表-->
            <div class="form-group" style="text-align:center;" v-cloak >
                    <el-table
                            ref="optionName2Table"
                            :data="quoteOptionName2List"
                            border
                            tooltip-effect="dark"
                            style="width: 80%"

                            @selection-change="handleMaterialSelection">
                        <el-table-column
                                type="selection"
                                width="55">
                        </el-table-column>
                        <el-table-column
                                type="index" label="序号"
                                header-align="center"  width="190">
                        </el-table-column>
                        <el-table-column
                                prop="id"
                                label="序号"
                                width="80"
                                v-if="showList">
                        </el-table-column>
                        <el-table-column
                                prop="optionName2"
                                label="材料克重（名称）"
                                width="190">
                        </el-table-column>
                    </el-table>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">
                </div>
                <input type="button" class="btn btn-primary  btn-sm" @click="save" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning  btn-sm" @click="reload" value="返回"/>
            </div>
        </form>
    </div>


        <!--模态窗修改-->
           <div>
            <el-dialog
                    title="修改"
                    :visible.sync="updateFlag" >
                <form class="form-horizontal">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">材料</div>
                        <div class="col-sm-10">
                            <template>
                                <el-input size="small" v-model="quoteFastPrintMaterial.optionName" disabled></el-input>
                            </template>
                        </div>
                    </div>
                    <!--optionName2列表-->
                    <div class="form-group" style="text-align:center">
                        <el-table
                                ref="updateTable"
                                :data="quoteOptionName2List"
                                border
                                tooltip-effect="dark"
                                style="width: 100%"
                                @selection-change="handleMaterialSelection">
                            <el-table-column
                                    type="selection"
                                    width="55">
                            </el-table-column>
                            <el-table-column
                                    type="index" label="序号"
                                    header-align="center"  width="240">
                            </el-table-column>
                            <el-table-column
                                    prop="id"
                                    label="序号"
                                    width="80"
                                    v-if="!updateFlag">
                            </el-table-column>
                            <el-table-column
                                    prop="optionName2"
                                    label="材料克重（名称）"
                                    width="240">
                            </el-table-column>
                        </el-table>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">
                        </div>
                        <input type="button" class="btn btn-primary  btn-sm" @click="update" value="确定"/>
                        &nbsp;&nbsp;<input type="button" class="btn btn-warning  btn-sm" @click="closeUpdateDialog" value="返回"/>
                    </div>
                </form>
                </el-dialog>
            </div>

        <!--模态框显示打印机-->
        <div>
            <el-dialog
                    title="生成组合"
                    :visible.sync="dialogVisible"
                    width="60%">
                <!--快印打印机列表-->
                <div class="form-group" style="text-align:center">
                    <el-table
                            ref="printTable"
                            :data="printList"
                            border
                            tooltip-effect="dark"
                            style="width: 80%"
                            :header-cell-style="{'text-align':'center'}"
                            @selection-change="handlePrintListSelection">
                        <el-table-column
                                type="selection"
                                width="55">
                        </el-table-column>
                        <el-table-column label="id" width="180" v-if="false">
                            <template slot-scope="scope" >
                                <span >{{ scope.row.id}}</span>
                            </template>
                        </el-table-column>
                        <el-table-column label="颜色" width="180" >
                            <template slot-scope="scope">
                                <span>{{ scope.row.colour=='multicolour'?"彩色":"黑白"}}</span>
                            </template>
                        </el-table-column>
                        <el-table-column label="打印纸张尺寸长/mm" width="180">
                            <template slot-scope="scope">
                                <span>{{ scope.row.paperLength}}</span>
                            </template>
                        </el-table-column>
                        <el-table-column label="打印纸张尺寸宽/mm" width="180">
                            <template slot-scope="scope">
                                <span>{{ scope.row.paperWide}}</span>
                            </template>
                        </el-table-column>
                        <el-table-column  label="单双面">
                        <template slot-scope="scope">
                            <el-select v-model="scope.row.singleDoubleFace" placeholder="请选择">
                                <el-option
                                        v-for="item in singlepairTypeEnum"
                                        :key="item.value"
                                        :label="item.describe"
                                        :value="item.value">
                                </el-option>
                            </el-select>
                        </template>
                        </el-table-column>
                    </el-table>
                </div>
                <span slot="footer" class="dialog-footer">
                <el-button @click="cancelDialog">取 消</el-button>
                <el-button type="primary" @click="generateGroup">确 定</el-button>
              </span>
            </el-dialog>
        </div>
</div>


<script src="${request.contextPath}/statics/js/modules/quoteFastPrintMaterial/quotefastprintmaterial.js?_${.now?long}"></script>
</body>
</html>